{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "import numpy as np\n",
    "import torchgeometry\n",
    "np.set_printoptions(suppress=True)\n",
    "torch.set_printoptions(precision=4,sci_mode=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4, 6, 3)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pose_data = [\n",
    "    [[0,0,0],[1,1,1],[2,2,2],[3,3,3],[4,4,4],[5,5,5]],\n",
    "    [[0,0,0],[1,1,1],[2,2,2],[3,3,3],[4,4,4],[5,5,5]],\n",
    "    [[0,0,0],[1,1,1],[2,2,2],[3,3,3],[4,4,4],[5,5,5]],\n",
    "    [[0,0,0],[1,1,1],[2,2,2],[3,3,3],[4,4,4],[5,5,5]]\n",
    "]\n",
    "pose_data = np.array(pose_data)\n",
    "pose_data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "order = [0, 1, 4, 5, 2, 3]\n",
    "pose_data_bvh = np.array([])\n",
    "for i in order:\n",
    "    if i==0:\n",
    "        pose_data_bvh = pose_data[:,i,:]\n",
    "    else:\n",
    "        pose_data_bvh = np.concatenate((pose_data_bvh, pose_data[:,i,:]), axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0, 0, 0, 1, 1, 1, 4, 4, 4, 5, 5, 5, 2, 2, 2, 3, 3, 3],\n",
       "       [0, 0, 0, 1, 1, 1, 4, 4, 4, 5, 5, 5, 2, 2, 2, 3, 3, 3],\n",
       "       [0, 0, 0, 1, 1, 1, 4, 4, 4, 5, 5, 5, 2, 2, 2, 3, 3, 3],\n",
       "       [0, 0, 0, 1, 1, 1, 4, 4, 4, 5, 5, 5, 2, 2, 2, 3, 3, 3]])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pose_data_bvh"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4, 18)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pose_data_bvh.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4, 6, 3)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pose_data_bvh = pose_data_bvh.reshape(4,-1,3)\n",
    "pose_data_bvh.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "pytorch39",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
